package com.hzpd.hainan.module.usercenter.acticity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import com.hzpd.hainan.R;
import com.hzpd.hainan.api.InterfaceJsonfile;
import com.hzpd.hainan.app.ToolBarActivity;

import butterknife.BindView;

public class AgreementActivity extends ToolBarActivity {
    @BindView(R.id.tv_title)
    TextView tv_title;
    @BindView(R.id.webview_agree)
    WebView webview_agree;

    @Override
    public String initToolBarTitle() {
        return null;
    }

    @Override
    public int setMyContentView() {
        return R.layout.activity_agreement;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        tv_title.setText("用户注册协议");
        webview_agree.loadUrl(InterfaceJsonfile.USERLOG);
        WebSettings webSettings=webview_agree.getSettings();

        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(true);//设置缩放
        webSettings.setBuiltInZoomControls(true);//设置出现缩放工具

        webSettings.setUseWideViewPort(true);//扩大比例的缩放
        //自适应屏幕
        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        webSettings.setLoadWithOverviewMode(true);
        webview_agree.setWebViewClient(new WebViewClient());
    }
}
